package com.sunxueqi.framework.web.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.sunxueqi.common.exception.UserException;
import com.sunxueqi.framework.web.vo.ResponseData;

/**
 * 全局异常处理器
 * @author Sun
 *
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

	@ExceptionHandler(UserException.class)
	public ResponseData userException(UserException e) {
		System.out.println("全局异常处理器");
		return ResponseData.error(e.getMessage());
	}
}
